package com.project.controller;

import com.project.bean.PowerBean;
import com.project.service.IPowerService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Set;

@RestController
@RequestMapping("power")
public class PowerController {
    @Autowired
    private IPowerService powerService;

    @RequestMapping("findAll")
    public List<PowerBean> findAll() {
        return powerService.findAll();
    }

    @RequestMapping("findByItem")
    public Set<PowerBean> findByItem(Integer[] roles) {
        return powerService.findByItem(roles);
    }
}
